import { ref } from 'vue'
const nowTime = ref('00:00:00')
const test = ref(0)
const addTest = (): void => {
    test.value++
}
const getNowTime = (): void => {
    const now: Date = new Date();
    const hour: string = now.getHours() < 10 ? "0" + now.getHours() : "" + now.getHours();
    const minu = now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
    const sec = now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
    nowTime.value = hour + ":" + minu + ":" + sec;
    setTimeout(getNowTime, 1000);
}
export {
    nowTime,
    getNowTime,
    addTest,
    test
}